﻿using System;

namespace DivShare
{
    /// <summary>
    /// Provides data for the <see cref="E:UploadWebFileCompleted"/> event of a <see cref="DivShareClient"/>.
    /// </summary>
    public class UploadWebFileCompletedEventArgs : EventArgs
    {
        /// <summary>
        /// Gets a value indicating which error occurred during uploading webfile.
        /// </summary>
        /// <value>An <see cref="Exception"/> instance, if an error occurred during uploading webfile; otherwise <c>null</c>.</value>
        public Exception Error { get; protected set; }

        /// <summary>
        /// Gets the id of webfile that is uploaded by a <see cref="M:UploadWebFileAsync"/> method.
        /// </summary>
        /// <value>The if of the webfile.</value>
        public string FileId { get; protected set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="UploadWebFileCompletedEventArgs"/> class.
        /// </summary>
        /// <param name="webFileId">The id of webfile that is uploaded.</param>
        /// <param name="ex">The exception occured during uploading webfile.</param>
        internal UploadWebFileCompletedEventArgs(string webFileId, Exception ex)
        {
            FileId = webFileId;
            Error = ex;
        }
    }
}
